package com.jimline.newRate.core;

import java.util.ArrayList;

public class ResourceController {
    private static ResourceController m_inst = null;
    private ResBase m_resource = null;
    
    public static ResourceController instance()
    {
    	if (null == m_inst) {
    		m_inst = new ResourceController();
    	}
    	return m_inst;
    }
    
    public ResourceController()
    {
    	m_resource = new DefaultRes();
    }
    
    public float calculateRate(float incoming, float outgoing){
        if (null != m_resource) {
            return m_resource.calculateRate(incoming, outgoing);
        }
        return -1;
    }
    
    public ArrayList<String> getIncomingItem()
    {
        if (null != m_resource) {
            return m_resource.getIncomingItem();
        }

        return new ArrayList<String>();
    }

    public ArrayList<String> getOutgointItem()
    {
        if (null != m_resource) {
            return m_resource.getOutgointItem();
        }

        return new ArrayList<String>();
    }
    
    public float getStartMoney()
    {
        if (null != m_resource) {
            return m_resource.getStartMoney();
        }

        return 0.0f;
    }
}
